<script type="text/html" data-template-name="kafka-producer">
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
    </div>

    <div class="form-row">
        <label for="node-input-bootstrapServers"><i class="fa fa-globe"></i> <span>Broker</span></label>
        <input type="text" id="node-input-bootstrapServers" placeholder="">
    </div>

    <div class="form-row">
        <label for="node-input-topic"><i class="fa fa-server"></i> <span>Topic</span></label>
        <input type="text" id="node-input-topic">
    </div>

</script>

<script type="text/javascript">
    (function () {

        RED.nodes.registerType('kafka-producer', {
            category: 'network',
            name: "写入Kafka",
            color: "#ffffff",
            defaults: {
                name: {value: ""},
                bootstrapServers: {  value: "",required: true},
                topic: {
                    value: "", required: false
                }
            },
            inputs: 1,
            outputs: 0,
            icon: "kafka.svg",
            label: function () {
                return this.name || "写入Kafka";
            },
            labelStyle: function () {
                return this.name ? "node_label_italic" : "";
            },
            oneditprepare: function () {

            },
            oneditsave: function () {

            }
        });
    })()
</script>
